//File Name: main.cpp
//Author: 
//Mail: 
//Created Time: Wed May 24 00:00:29 2017
#include <algorithm>
#include <math.h>

#include <vector>
#include <stdio.h>

//¹̶¨²Îýct
struct strParam
{

	int     Num;
	int		User_E;
	double 	User_Uair;
	long double 	User_d;

};

//´洢½á
struct strResult
{				 //11
	long double  result_d;
	double  result_c1;
};

strParam m_strNum[11];
void init()
{
	m_strNum[0].User_d = 0.000675;
	m_strNum[1].User_d = 0.000815;
	m_strNum[2].User_d = 0.000965;
	m_strNum[3].User_d = 0.001117;
	m_strNum[4].User_d = 0.000743;
	m_strNum[5].User_d = 0.000895;
	m_strNum[6].User_d = 0.001132;
	m_strNum[7].User_d = 0.001380;
	m_strNum[8].User_d = 0.000764;
	m_strNum[9].User_d = 0.000915;
	m_strNum[10].User_d = 0.001287;
	m_strNum[11].User_d = 0.001664;

	m_strNum[0].User_Uair = 23.59;
	m_strNum[1].User_Uair = 47.18;
	m_strNum[2].User_Uair = 94.36;
	m_strNum[3].User_Uair = 188.72;
	m_strNum[4].User_Uair = 23.59;
	m_strNum[5].User_Uair = 47.18;
	m_strNum[6].User_Uair = 94.36;
	m_strNum[7].User_Uair = 188.72;
	m_strNum[8].User_Uair = 23.59;
	m_strNum[9].User_Uair = 47.18;
	m_strNum[10].User_Uair = 94.36;
	m_strNum[11].User_Uair = 188.72;

	m_strNum[0].User_E = 90000;
	m_strNum[1].User_E = 90000;
	m_strNum[2].User_E = 90000;
	m_strNum[3].User_E = 90000;
	m_strNum[4].User_E = 40000;
	m_strNum[5].User_E = 40000;
	m_strNum[6].User_E = 40000;
	m_strNum[7].User_E = 40000;
	m_strNum[8].User_E = 30000;
	m_strNum[9].User_E = 30000;
	m_strNum[10].User_E = 30000;
	m_strNum[11].User_E = 30000;
}
int main()
{	
	std::vector<strResult> m_gvecResult;
	init();
	double c1 = 0;

	for (int cc = 1; cc <= 1000; cc++)
	{
		long double  dsum = 0;
		for (int index = 0; index <= 11; index++)
		{
			c1 = cc / 100.00000;

#if 1	
			//0.0039773387421763434  ¼ÆãËµÄ pow£¨µ×ýý½á0.0039773387421763434
			long double temp1 = 0.38132*pow(m_strNum[index].User_E*1.0000000000000000000000000, -0.4);
			//1.6817374136635403077644873974357  ¼ÆãËµÄ pc½á1.6817374136635403
			long double temp2 = (0.666*pow(m_strNum[index].User_Uair / 1.80000000, 0.36));
			//0.99999999629629632

			long double temp3 = -c1 / (2.7e6);
			long double temp4 = exp(temp3);

			long double tempResult = temp1 + temp4;
			//double temp5=  temp1+temp4;

#endif

			int tempt = 1;

			//·½²î		
            dsum = (tempResult - m_strNum[index].User_d)*(tempResult - m_strNum[index].User_d) + dsum;

		}
		strResult steTemp;
		steTemp.result_c1 = cc / 100.00;
		steTemp.result_d = dsum;
		int num = m_gvecResult.size();
		printf("%lf\n", dsum);

		m_gvecResult.push_back(steTemp);

	}
	return 0;
}
